<script src="__STATIC__/plugins/validator/js/validator.min.js"></script>
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">{$web_data['web_title']}</h3>
            </div>
            <form id="dataForm" role="form" action="" enctype="multipart/form-data" method="post">
                <div class="box-body">
                    {if isset($info)}<input type="hidden" name="id" value="{$info.id}">{/if}
                    <div class="form-group">
                        <label for="user_name">用户名</label>
                        <input value="{$info.user_name|default=''}" name="user_name" placeholder="请输入用户名" type="text" id="user_name" class="form-control">
                    </div>
                    <div class="form-group">
                        <label for="password">密码</label>
                        <input value="{$info.password|default=''}" type="password" name="password" id="password" class="form-control" placeholder="请输入密码">
                    </div>
                </div>
                <!-- /.box-body -->
                {include file="template/action_footer" /}
            </form>
        </div>
    </div>
</div>


<script type="text/javascript">

    $(function () {

        $("#dataForm").bootstrapValidator({
            message: '请输入用户名/密码',
            fields: {
                user_name: {
                    validators: {
                        notEmpty: {
                            message: '户名不能为空'
                        },
                        regexp: {
                            regexp: /^[a-zA-Z][a-zA-Z0-9_]{4,9}$/i,
                            message: '用户名以字母开头，长度在5~10 之间，只能包含字符、数字和下划线'
                        }
                    }
                },
                password: {
                    validators: {
                        notEmpty: {
                            message: '密码不能为空'
                        }
                    }
                }
            }
        });
    });
</script>